<?php

namespace App\Repositories\Eloquent\Exm;

use Illuminate\Container\Container as App;
use App\Repositories\Eloquent\Repository;

class QuizRepository extends Repository
{

    /**
     * @param App
     */
    public function __construct(App $app)
    {
        parent::__construct($app);
    }

    /**
     * 指定模型名称
     *
     * @return mixed
     */
    function model()
    {
        return 'App\Models\Exm\Quiz';
    }


    public function index($type = '')
    {
        $result = $this->model->orderBy('id', 'asc')->get();

        return $result;
    }


    public function isAttend($request)
    {
        $rows = $this->model->where('idcard',$request->idcard)->orWhere('mobile',$request->mobile)->get();

        if($rows->count() > 0)
            return true;

        return false;
    }


}